package com.icart.repositories;


import com.icart.entities.CuCusttcEntity;
import com.icart.entities.WoInfopayEntity;
import org.springframework.context.annotation.Scope;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigInteger;

@Repository
@Scope("prototype")
public interface WoinfopayRepository extends BaseRepository<WoInfopayEntity,Integer> {
    @Transactional
    @Query(nativeQuery = true,value = "insert into wo_infopay (oid, custid, tradeid, paytype, amount, tradetime, payee, receivno) " +
            "select ?1,?2,?3,'wx',saleprice,?4,0,?5 from mk_discpack where tcid=?6")
    @Modifying(clearAutomatically = true)
    Integer savewoin(String oid, Long custid, String tradeid, String time, String incomeid, Long tcid);
}
